//-----------------------------------------------------------------------
// <copyright file="ClearAllPools.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
// </copyright>
// <author>Giles Knap</author>
// <email></email>
// <date>2006-05-07</date>
// <summary> Clear all connections in the Sql Connection Pools</summary>
//-----------------------------------------------------------------------

namespace Microsoft.Sdc.Tasks.Sql
{
    using System;
    using System.Xml;
    using System.Globalization;
    using System.IO;
    using System.Data;
    using System.Data.SqlClient;
    using SdcSql = Microsoft.Sdc.Tasks.Configuration.SqlServer;
    using Microsoft.Build.Framework;


    /// <summary>
    /// Clear all connections in the Sql Connection Pools
    /// </summary>
    /// <remarks>
    /// <code><![CDATA[<Sql.ClearAllPools />]]></code>
    /// </remarks>
    /// <example>
    /// <code><![CDATA[
    /// <Project>
    ///     <Target Name="Test" >
    ///         <Sql.ClearAllPools />
    ///     </Target>
    /// </Project>
    /// ]]></code>    
    /// </example>
    public class ClearAllPools : SqlBase
    {
        /// <summary>
        /// Initializes a new instance of the ClearAllPools class.
        /// </summary>
        public ClearAllPools()
        {
        }

        /// <summary>
        /// Performs the action of this task.
        /// </summary>
        protected override void InternalExecute()
        {
            #region Execute code
            SqlConnection.ClearAllPools();
            #endregion
        }
    }
}
